<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>搜索</title>
    <!--    <link rel="stylesheet" href="css/semantic.min.css">-->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css">

</head>
<body>
<!--导航-->
<nav class="ui inverted attached segment m-padded-tb-mini m-shadown-small" ><!--th:replace="_fragments :: menu(0)"-->
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui header teal item">ZhouChb</h2>
            <a href="#" th:href="@{/}" class="m-item item m-mobile-hide"><i class="home icon"></i>首页</a>
            <a href="#" th:href="@{/types/-1}" class="active m-item item m-mobile-hide"><i class="idea icon"></i>分类</a>
            <a href="#" th:href="@{/tags/-1}" class="m-item item m-mobile-hide"><i class="tags icon"></i>标签</a>
            <a href="#" th:href="@{/archives}" class="m-item item m-mobile-hide"><i class="clone icon"></i>归档</a>
            <a href="#" th:href="@{/about}" class="m-item item m-mobile-hide"><i class="info icon"></i>关于我</a>
            <div class="right item m-item m-mobile-hide"><!--style="margin-right: 50px !important;"-->
                <form action="#"  name="search" method="post" th:action="@{/search}" target="_blank">
                    <div class="ui icon input">
                        <input id="inputSearch" type="text" name="query" placeholder="搜索..." style="width: 260px" th:value="${query}">
                        <i onclick="document.forms['search'].submit()" class="search link icon"></i>
                    </div>
                </form>
<!--                <div class="ui icon input">
                    <input type="text" placeholder="搜索" style="width: 260px">
                    <i class="search link icon"></i>
                </div>-->
            </div>
            <div class="item mini m-padded-tb-mini m-item  m-mobile-hide"></div>
        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show ">
        <i class="sidebar icon"></i>
    </a>
</nav>
<!--=========================中间内容==============================-->
<div class="m-padded-tb-larges m-container-mini ">
    <!--===头部====-->
    <div class="ui top attached segment">
        <div class="ui middle aligned two column grid">
            <div class="column">
                <h3 class="ui violet header ">搜索结果</h3>
            </div>
            <div class="right aligned column">
                共 <h2 class="ui  header m-font-thin m-inline-block broadcast" th:text="${searchblogPageInfo.total}">
                18</h2> 篇
            </div>
        </div>
    </div>

    <div class="ui  top attached violet segment">
        <div class="ui middle aligned padded vertical segment  m-padded-lr-medium "
             th:each="blog : ${searchblogPageInfo.list}">
            <div class="m-dispalty " id="next_page" th:text="${searchblogPageInfo.pageNum}+1"></div>
            <div class="m-dispalty " id="pre_page" th:text="${searchblogPageInfo.pageNum}-1"></div>
            <div class="ui  mobile reversed  stackable grid">
                <div class="eleven wide column">
                    <h3 class="ui header"><a th:href="@{/blog/{id}(id=${blog.id})}" th:text="${blog.title}"
                                             class="m-font-black" target="_blank">壮我道宗！</a></h3>
                    <p class="m-font" th:text="${blog.description}">“林动师兄，请壮我道宗！”
                        低沉如雷鸣般的声音，在这天地间轰然的回荡起来，那股莫名的情感，重重的撞击在林动的心头，这一刻，巨大的酸楚，冲击着胸膛，令得他那眼睛也是泛红了起来。</p>
                    <div class="ui grid">
                        <!--左边-->
                        <div class="eleven wide column">
                            <div class="ui mini horizontal link list">
                                <div class="item">
                                    <img src="../static/images/touxiang.jpg"
                                         th:src="@{${blog.user.avatar}}" style="width: 22px;height: 22px"
                                         class="ui avatar image">
                                    <div class="content "
                                         style="margin-left: 4px;font-size:8px;font-weight: 660"><span
                                            th:text="${blog.user.nickname}">ZhouChb</span>
                                    </div>
                                </div>
                                <div class="item">
                                    <i class="calendar icon" style="width: 100px!important;">&nbsp;<span
                                            th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2021-8-29</span></i>
                                </div>
                                <div class="item">
                                    <i class="eye icon">&nbsp;<span th:text="${blog.views}">8888</span></i>
                                </div>
                            </div>
                        </div>
                        <!--右边标签-->
                        <div class="right aligned five wide column">
                            <a href="#" target="_blank"
                               class="ui mini orange label basic  m-font-thin-normal m-padded-mini"
                               th:text="${blog.type.name}">认识升级</a>
                        </div>
                    </div>
                </div>
                <div class="five wide column">
                    <a href="#" target="_blank"><img class="ui rounded image m-img"
                                                     src="../static/images/liuxing.png"
                                                     th:src="@{${blog.firstPicture}}"></a>
                    <!--    style="width: 13em;height: 9em"-->
                </div>

            </div>
        </div>

    </div>

    <!--========页码========-->
    <div class="ui attached bottom attached segment">
        <div class="ui middle  aligned two column grid "> <!---->
            <div class="column"><!-- th:href="@{/search/{pn}(pn=${searchblogPageInfo.pageNum}-1)}"-->
                <a href="#" id="btn_pre" th:classappend="${searchblogPageInfo.isFirstPage}?'disabled'"
                   class="ui mini link blue  button m-margin-left-big">上一页</a>
            </div>
            <div class=" right aligned  column"><!---->
                <a id="btn_next"   th:classappend="${searchblogPageInfo.isLastPage}?'disabled'"
                   class="ui mini link blue  button m-margin-right-big">下一页</a>
            </div><!--th:href="@{/search(pn=${searchblogPageInfo.pageNum}+1)}"-->
        </div>
    </div>
</div>

</div>
</div>
<br>
<!--========================底部footer===============================-->
<!---->
<footer class="ui inverted vertical segment m-padded-tb-big" th:replace="_fragments :: footer">
    <div class="ui center aligned container">
        <div class="ui stackable inverted divided grid">
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="../static/images/meWechat.jpg" class="ui rounded image" alt="" style="width: 110px">
                    </div>
                </div>
            </div>
            <div class="four wide column">
                <h4 class="ui inverted header  m-font-spaced" style="font-weight: normal">最新博客</h4>
                <div class="ui inverted link list m-font-thin">
                    <a href="#" class="item">笔记01</a>
                    <a href="#" class="item">笔记01</a>
                    <a href="#" class="item">笔记01</a>
                </div>
            </div>

            <div class="five wide column">
                <h4 class="ui inverted header" style="font-weight: normal">Blog介绍</h4>
                <p class="m-font-thin m-font-spaced m-opacity-mini ">修炼一途，乃窃阴阳，夺造化，转涅槃，握生死，掌轮回。 武之极，破苍穹，动乾坤！</p>
            </div>
            <div class="four wide column">
                <h4 class="ui inverted header  m-font-spaced" style="font-weight: normal">联系我</h4>
                <div class="ui inverted  list" style="text-align: left;margin-left: 30px">
                    <div class="item">
                        <img src="../static/images/qq.png" style="width: 20px">
                        <span class="m-font-thin m-opacity-mini"
                              style="font-size: 14px">&nbsp;&nbsp;QQ：2251073096</span>
                    </div>
                    <div class="item">
                        <img src="../static/images/email.png" style="width: 18px">
                        <span class="m-opacity-mini" style="font-size: 14px">&nbsp;&nbsp;Eamil：2251073096@qq.com</span>
                    </div>
                </div>
            </div>
        </div>

        <div class="ui inverted section divider"></div>
        <p class="m-font-thin m-font-spaced m-opacity-tiny" style="font-size: 13px">Copyright © 2021 - 2022 ZhouChB All
            Rights Reserved V.1.0</p>
    </div>
</footer>
<script src="../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
<script src="../static/js/semantic.min.js" th:src="@{/js/semantic.min.js}"></script>
<script src="../static/js/my.js" th:src="@{/js/my.js}"></script>
<script>
    $('#btn_pre').click(function () {

               var pn = [[${searchblogPageInfo.pageNum}-1]]
               var query = document.getElementById("inputSearch").value
               var form = $("<form action='/search' method='post' style='display: none!important;'> " +
                   "<input name='pn' value="+pn+">" +
                   "<input name='query' value="+query+
                   "></form>");
               $('body').append(form);  //将表单放置在web中
               form.submit();	//表单提交
    });

    $("#btn_next").click(function () {
        var pn = [[${searchblogPageInfo.pageNum}+1]]
        var query = document.getElementById("inputSearch").value
        var form = $("<form action='/search' method='post' style='display: none!important;'> " +
            "<input name='pn' value="+pn+">" +
            "<input name='query' value="+query+
            "></form>");
        $('body').append(form);  //将表单放置在web中
        form.submit();	//表单提交
    });

</script>
<!--/*/</th:block>/*/-->
</body>
</html>